/**
 * <p>文件名:		ProbeModelDecoder.java</p>
 * <p>版权:		CopyrightTag</p>
 * <p>公司:		CompanyTag</p>
 * @author		周华彬(zhouhuabin@ctfo.com, zhou_hua_bin@163.com)
*/

package com.caits.lbs.framework.services.kafka;

import kafka.serializer.Decoder;
import kafka.utils.VerifiableProperties;

import org.apache.log4j.Logger;

import com.caits.lbs.framework.log.CommonLogFactory;

/**
 * <p>ProbeModelDecoder</p>
 * <p>TODO</p>
 *
 * @author		周华彬(zhouhuabin@ctfo.com, zhou_hua_bin@163.com)
 * @version		0.0.0
 * <table style="border:1px solid gray;">
 * <tr>
 * <th width="100px">版本号</th><th width="100px">动作</th><th width="100px">修改人</th><th width="100px">修改时间</th>
 * </tr>
 * <!-- 以 Table 方式书写修改历史 -->
 * <tr>
 * <td>0.0.0</td><td>创建类</td><td>zhouhuabin</td><td>2015年4月27日 下午2:58:23</td>
 * </tr>
 * <tr>
 * <td>XXX</td><td>XXX</td><td>XXX</td><td>XXX</td>
 * </tr>
 * </table>
 * @param <T>
 */
@SuppressWarnings("hiding")
public class ProbeModelDecoder<T> implements Decoder<T> {
	public  ProbeModelDecoder(VerifiableProperties props){
		    if(props != null)
		      props.getString("serializer.encoding", "UTF8");
	}
	/** 日志记录器 */
	protected Logger log = CommonLogFactory.getLog();
	@SuppressWarnings("unchecked")
	@Override
	public T fromBytes(byte[] data) {
		T model=null;
		try {
			//TODO:自己反序列化成需要的对象
//			model = (T) parseLocationUgcBytes(data);
			return model;
		} catch (Exception e) {
			log.error("解析ugc数据异常", e);
		}
		return model;
	}

}
